package uvt.gui.mainframe.object.memento.container;

import java.util.Map;
import java.util.TreeMap;

import uvt.gui.mainframe.object.memento.ButtonOperations;
import uvt.gui.mainframe.object.memento.PreviousOperationToCareTaker;
import uvt.gui.mainframe.object.memento.PreviousOperationToOriginator;

public class ButtonOperationBackup {
	
	private static ButtonOperationBackup instance;
	
	private Map<ButtonOperations,PreviousOperationToCareTaker> list;
	
	private ButtonOperationBackup() {
		list = new TreeMap<ButtonOperations,PreviousOperationToCareTaker>();
	}
	
	public static ButtonOperationBackup getInstance() {
		if(instance == null)
			instance = new ButtonOperationBackup();
		return instance;
	}
	
	public void addReference(ButtonOperations op,PreviousOperationToCareTaker cont) {
		list.put(op,cont);
	}
	
	public PreviousOperationToOriginator getPreviousOperationToCareTakerFromReference(ButtonOperations op) {
		return (PreviousOperationToOriginator)list.get(op);
	}

}
